//导航栏公告上下滚动
function notice(id){
  return document.getElementById(id);
 }
 var DocScroll={
  picH:32,
  scrollstep:5,
  scrolltime:100,
  stoptime:8000,
  tmpH:0,
  Mar:null,
  stop:false,
  init:function(obj){
   DocScroll.Mar = notice(obj); 
   
   DocScroll.Mar.onmouseover = function(){DocScroll.stop = true};
   DocScroll.Mar.onmouseout = function(){ DocScroll.stop = false};
   
   DocScroll.child_div=DocScroll.Mar.getElementsByTagName("li");
   DocScroll.Mar.innerHTML += DocScroll.Mar.innerHTML; 
   setTimeout(DocScroll.start,DocScroll.stoptime);
  },
  start:function(){
    if(DocScroll.tmpH < DocScroll.picH){ 
     DocScroll.tmpH += DocScroll.scrollstep; 
     if(DocScroll.tmpH > DocScroll.picH )DocScroll.tmpH = DocScroll.picH ; 
     DocScroll.Mar.scrollTop = DocScroll.tmpH; 
     setTimeout(DocScroll.start,DocScroll.scrolltime); 
    }else{ 
     DocScroll.tmpH = 0; 
     DocScroll.Mar.appendChild(DocScroll.child_div[0]); 
     DocScroll.Mar.scrollTop = 0; 
     setTimeout(DocScroll.start,DocScroll.stoptime); 
    } 
  }
 }
 


//网站收藏
function addfavorite() { 
var browserName=navigator.userAgent.toLowerCase();
if(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName)){alert("︶_︶\n　\n您好，您使用的Chrome浏览器不支持此操作，请手动收藏！")};

   if(document.all) {window.external.addFavorite('http://www.umishop.com.cn/','优美世界官方商城');} 
   else if (window.sidebar){window.sidebar.addPanel('优美世界官方商城', 'http://www.umishop.com.cn/', "");} 
} 

//去除空格
function ltrim(s){return s.replace(/(^\s*)/, "");}   
function rtrim(s){return s.replace(/(\s*$)/, "");}      
function trim(s){return rtrim(ltrim(s));}